<template>
  <div id="app">
    <Header v-if="topbar_show"></Header>
    <NavBar v-if="topbar_show"></NavBar>
    <router-view 
    @event="getUserInfo"
    @public_header="public_header" v-if="isRouterAlive"/>
    <Footer v-if="footer_show"></Footer>
    <floatingBox />
  </div>
</template>
<script>
import NavBar from './components/home/NavBar.vue'
import Header from './components/home/Header.vue'
import Footer from './components/home/Footer.vue'
import floatingBox from './components/floatingBox/floatingBox.vue'

export default {
  name:'',
  components:{
    NavBar,Header,Footer,floatingBox
  },
  data(){
    return{
      topbar_show:true,
      footer_show:true,
      isRouterAlive: true
    }
  },
  provide () {
    return{
      reload: this.reload
    }
  },
  methods:{
    getUserInfo(data){
      console.log(data,'99999');
    },
    reload(){
      this.isRouterAlive = false
      this.$nextTick(function(){
        this.isRouterAlive = true
      })
    },
    public_header(bool){
      this.topbar_show=bool.header;
      this.footer_show=bool.footer;
    }
  }
};
</script>


<style scoped lang="less">
#app{
  min-height: 100vh;
    position: relative;
    padding-bottom: 222px; /* 底部导航栏的高度 */
    box-sizing: border-box;
    font-family: Helvetica Neue, tahoma, arial, "Microsoft Yahei", "宋体", sans-serif !important;
}
</style>
